package com.bi.autotest.cases.payprocess;

import com.auto.base.Assertion;
import com.auto.base.InitAppium;
import com.bi.autotest.operations.payprocessoperation.NewMyLoginOperation;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.net.MalformedURLException;

public class NewMyLogin extends InitAppium {
    private NewMyLoginOperation newMyLoginOperate;

    @BeforeClass
    public void initDriver() {
        try {
            setUp();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        Assert.assertNotNull(driver);
        newMyLoginOperate = new NewMyLoginOperation(driver);
    }


    /**
     * 测试用户名、密码都正确的情况
     */
    @Test(priority = 0)
    public void loginCorrect() {
        boolean isLoginPage = newMyLoginOperate.LoginPre();
       // Assertion.verifyEquals(isLoginPage, true, "判断是否进入了登录页面");
        print("判断是否进入了登录页面：" + isLoginPage);
        boolean isLoginSucess = newMyLoginOperate.login("17718345309", "999999");
        Assertion.verifyEquals(isLoginSucess, true, "用户名、密码都正确的情况下 是否登录成功");
        print("用户名、密码都正确的情况下 是否登录成功：" + isLoginSucess);
    }
}
